<template>
  <div class="leftList">
    <div class="item" id="item">
      <router-link tag="p" to="/">后台首页</router-link>
    </div>
    <div class="item" id="item">
      <p @click="show('nav01')" :class="{active:navList.nav01==true}"><i></i>商品管理</p>
      <div class="itemList" v-if="navList.nav01">
        <router-link tag="a" to="prcList">商品列表</router-link>
        <router-link tag="a" to="prcAdd">添加商品</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav02')" :class="{active:navList.nav02==true}"><i></i>商品分类管理</p>
      <div class="itemList" v-if="navList.nav02">
        <router-link tag="a" to="classList">分类列表</router-link>
        <router-link tag="a" to="classAdd">添加分类</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav03')" :class="{active:navList.nav03==true}"><i></i>当红分类管理</p>
      <div class="itemList" v-if="navList.nav03">
        <router-link tag="a" to="regionList">地区列表</router-link>
        <router-link tag="a" to="regionAdd">添加地区</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav04')" :class="{active:navList.nav04==true}"><i></i>当红分类列表</p>
      <div class="itemList" v-if="navList.nav04">
        <router-link tag="a" :to="{path:'/regionPrcList',query: {id:1}}">第一个分类</router-link>
        <router-link tag="a" :to="{path:'/regionPrcList',query: {id:2}}">第二个分类</router-link>
        <router-link tag="a" :to="{path:'/regionPrcList',query: {id:3}}">第三个分类</router-link>
        <router-link tag="a" to="regionPrcAdd">添加商品</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav05')" :class="{active:navList.nav05==true}"><i></i>会员管理设置</p>
      <div class="itemList" v-if="navList.nav05">
        <router-link tag="a" to="peopleList">会员列表</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav06')" :class="{active:navList.nav06==true}"><i></i>订单管理设置</p>
      <div class="itemList" v-if="navList.nav06">
        <router-link tag="a" to="orderList">订单列表</router-link>
        <router-link tag="a" to="orderListShow">订单详情</router-link>
        <router-link tag="a" to="sallList">优惠列表</router-link>
        <router-link tag="a" to="sallAdd">优惠设置</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav07')" :class="{active:navList.nav07==true}"><i></i>广告管理设置</p>
      <div class="itemList" v-if="navList.nav07">
        <router-link tag="a" to="bannerList">广告列表</router-link>
        <router-link tag="a" to="bannerAdd">添加广告</router-link>
      </div>
    </div>
<!--     <div class="item" id="item">
  <p @click="show('nav08')" :class="{active:navList.nav08==true}"><i></i>收货地区管理</p>
  <div class="itemList" v-if="navList.nav08">
    <router-link tag="a" to="addressList">地区列表</router-link>
    <router-link tag="a" to="addressAdd">添加地区</router-link>
  </div>
</div> -->
    <div class="item" id="item">
      <p @click="show('nav09')" :class="{active:navList.nav09==true}"><i></i>配送方式设置</p>
      <div class="itemList" v-if="navList.nav09">
        <router-link tag="a" to="deliveryList">配送方式列表</router-link>
        <router-link tag="a" to="deliveryAdd">添加配送方式</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav10')" :class="{active:navList.nav10==true}"><i></i>管理员设置</p>
      <div class="itemList" v-if="navList.nav10">
        <router-link tag="a" to="adminList">管理员列表</router-link>
        <router-link tag="a" to="adminAdd">添加管理员</router-link>
      </div>
    </div>
    <div class="item" id="item">
      <p @click="show('nav11')" :class="{active:navList.nav11==true}"><i></i>在线客服</p>
    </div>

  </div>
</template>
<script>
export default {
  name: 'leftList',
  data() {
    return {
      navList:{
        nav01:false,
        nav02:false,
        nav03:false,
        nav04:false,
        nav05:false,
        nav06:false,
        nav07:false,
        nav08:false,
        nav09:false,
        nav10:false,
      }
    }
  },
  methods:{
    show(val){
      for(let key in this.navList){
          this.navList[key]=false
      }
      this.navList[val]=true
      if(val=='nav11'){
        this.$router.push('/peopleList2')
      }
    }
  }
}

</script>
